public class Student extends Person{
    public String no;
    public double scoreEn;
    public double scoreMath;
    public double scoreCh;
   //父类中定义了有参构造方法，在子类中应该对父类中的成员变量初始化
    public Student(String name, String sex, int age, String no, double scoreEn, double scoreMath, double scoreCh) {
        super(name, sex, age);
        this.no = no;
        this.scoreEn = scoreEn;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }

    public double aver(){
        return (scoreCh+scoreMath+scoreEn)/3;
    }
    public double max() {
        double max = scoreCh > scoreEn ? scoreCh : scoreEn;
        max = max > scoreMath ? max : scoreMath;
        return max;
    }
    public double min() {
        double min = scoreCh < scoreEn ? scoreCh : scoreEn;
        min = min < scoreMath ? min : scoreMath;
        return min;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", no='" + no + '\'' +
                ", aver="+aver()+'\''+
                ", max="+max()+'\''+
                ",min="+min()+'\''+
                '}';
    }
}
